package com.better.frontend.service.user;

import com.better.backend.mqReceiverService.UserInfo.repository.UserInfoRepsitory;
import com.better.common.utils.EncryptUtils;
import com.better.frontend.Iservice.user.UserManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 用户管理接口实现
 * Created by wfm on 2018/1/6.
 */
@Service
public class UserManagerServiceImp implements UserManagerService {
    @Autowired
    private UserInfoRepsitory userInfoRepsitory;

    @Override
    public void updatePasswordById(String id, String loginName, String newPassword) {
        Map<String, Object> updateFieldMap = new HashMap<>();
        updateFieldMap.put("password", EncryptUtils.entryptPassword(newPassword));
        userInfoRepsitory.update(id, updateFieldMap);
    }
}
